function D = computeDimensions(D2)

D = 1;
while (D*(D+1)/2) < D2
    if (D*(D+1)/2) == D2
        break
    end
    D = D+1;
end
if (D*(D+1)/2) ~= D2
    error('Should never happen.')
end
